{include file="public/header" /}
<link rel="stylesheet" type="text/css" href="__STATIC__/index/css/bootstrap.css"/>
<script src="__STATIC__/layui/layui.js"></script>
<script src="__STATIC__/index/js/jquery-3.2.1.js"></script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>消息列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <div>
            	<form action="{:url('notice/selectNews')}" method="post">
              选择人员 ：<select name="personnel" id="personnel" >
              	    <option value="请选择">请选择</option>
            		<option value="0">全部人</option>
            		<option value="-1">放单人</option>
            		<option value="-2">跑单人</option>
            	</select>
            选择时间范围：<input type="text" class="layui-input" id="start_time" value="" name="start_time"  placeholder=""> 
                <input type="text" class="layui-input" id="end_time" value="" name="end_time"   placeholder="">
                	<input type="submit" value="查询"/>
            	</form>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th>ID</th>
                                <th>标题</th>
                                 <th>接收人</th>
                                <th>发布时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="list-content">
                        {volist name="arr" id="vo"}
                            <tr class="long-td">
                                <td>{$vo.id}</td>
                                <td>{$vo.title}</td>
                                {if $vo.uid==-1}
                                 <td>放单人</td>
                                 {elseif $vo.uid==-2}
                                 <td>跑单人</td>
                                 {elseif $vo.uid==0}
                                 <td>全部</td>
                                {/if}
                                <td>{$vo.add_time|date="Y-m-d H:i:s",###}</td>
                                <td>
                                   <a href="javascript:;" onclick="delUserType({$vo.id})" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> 删除</a>
                                </td>
                            </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- End Example Pagination -->
            <div id="">
            	{$arr->render()}
            </div>
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

{include file="public/footer" /}

<script type="text/javascript">
    function delUserType(id) {
      $.ajax({
      	type:"post",
      	url:"{:url('notice/deleteNews')}",
        data:{id:id},
        success:function(res){
        	if(res.code==1){
			layui.use('layer', function(){
					  var layer = layui.layer;
					  layer.alert(res.msg, {icon: 1},function(){
					     location.reload(); 
				    });
					});
        	}else if(res.code==0){
        		layui.use('layer', function(){
					  var layer = layui.layer;
					  layer.alert(res.msg, {icon: 2},function(){
					     location.reload(); 
				    });
					});
        	}
        }
      });   
    }
   
  /* function select_new(){
     var uid = $('#personnel').val();
     var start_time = $('#start_time').val();
     var end_time =$('#end_time').val();
     $.ajax({
     	type:"post",
     	url:"{:url('notice/selectNews')}",
     	data:{uid:uid,start_time:start_time,end_time:end_time},
     	success:function(res){
     	alert(res);	
     	}
     });
   }*/
    

  //时间插件
layui.use('laydate', function(){
  var laydate = layui.laydate;
   laydate.render({
    elem: '#start_time',
  });
  laydate.render({
    elem: '#end_time',
  });
})
</script>

</body>
</html>